/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.blue.xml;

import java.util.Enumeration;
import java.util.Properties;

/**
 * This interface define the behavior of an XMLElement.
 * @author kelvio
 */
public interface XMLElement {
    
    /**
     * Get a name of this XMLElement.
     * @return The name of this XMLElement.
     */
    String getName();
    
    /**
     * Get the value of this element.
     * @return The value of this element.
     */
    String getValue();
    
    /**
     * Get a named attribute of this element.
     * @param name The name of attribute.
     * @return The value of attribute.
     */
    String getAttribute(String name);
    
    /**
     * 
     * @param name
     * @return 
     */
    Integer getAttributeAsInteger(String name);
    
    
    /**
     * 
     * @param name
     * @return 
     */
    Double getAttributeAsDouble(String name);
    
    
    /**
     * 
     * @param name
     * @return 
     */
    Float getAttributeAsFloat(String name);
    
    /**
     * 
     * @param name
     * @return 
     */
    Boolean getAttributeAsBoolean(String name);
    
    /**
     * 
     * @param name
     * @return 
     */
    Short getAttributeAsShort(String name);
    
    
    /**
     * 
     * @param name
     * @return 
     */
    Byte getAttributeAsByte(String name);
    
    /**
     * Get a Property instance that contains the 
     * set of attributes of this element.
     * @return The attributes.
     */
    Properties getAttributes();
    
    /**
     * Get a child at specified index.
     * @param index The index.
     * @return A XMLElement child at specified index.
     */
    XMLElement getChild(int index);
    
    /**
     * Get the first child.
     * @return The XMLElement at index 0.
     */
    XMLElement getFirstChild();
    
    /**
     * Get the last child.
     * @return The XMLElement at size - 1 index.
     */
    XMLElement getLastChild();
    
    /**
     * Get a Enumeration of childs.
     * @return The childs enumeration.
     */
    Enumeration<XMLElement> enumerateChildren();
    
    /**
     * Get a enumeration of attribute names of this XMLElement.
     * @return The attribute names enumeration.
     */
    Enumeration<String> enumerateAttributeNames();
        
}
